package cn.com.infcn.monitor.timertask;

import com.alibaba.fastjson.JSON;

import cn.com.infcn.monitor.bean.IFCResponseBean;
import cn.com.infcn.monitor.core.MonitorCore;
import cn.com.infcn.monitor.util.IFCFileUtils;
import cn.com.infcn.monitor.util.IFCMonitorUtils;
import cn.com.infcn.monitor.util.MonitorType;

class MonitorLogThread implements Runnable {
	@Override
	public void run() {

		try {
			IFCResponseBean ifcResponseBean = MonitorCore.getIFCResponseBean(IFCMonitorUtils.getDefaultMonitorType());
			String json = JSON.toJSONString(ifcResponseBean);

			//写入到日志文件
			IFCFileUtils.writerMonitorInfo(json);
		} catch (Exception e) {
			e.printStackTrace();
		}

	}
}